package sparrowGui.vars
{
	import flash.display.DisplayObject;
	
	import sparrowGui.Component;
	import sparrowGui.SparrowGUI;
	import sparrowGui.utils.PubFun;
	
	/**
	 * 基本元件默认变量
	 * border:表格边框宽和边框颜色 0是无边框;borderColor:表格边框颜色,如果设有值了,则top,topColor则跳过
	 * bgColor底色 0是无底色,bgDisp是图形sprite;bgFilter是背景用的滤镜默认是没有,[]是阴影
	 */
	public class ComponentVars extends BaseComponentVars
	{
		public var bgColor:int = 0xFFFFFF;
		public var bgAlign:String = "TL";
		public var alpha:Number = 1;
		
		public var paddingTop: int;
		public var paddingRight: int;
		public var paddingBottom: int;
		public var paddingLeft: int;
		
		public var borderTop:int = 0;
		public var borderRight:int = 0;
		public var borderLeft:int = 0;
		public var borderBottom:int = 0;
		
		public var borderTopColor:int = 0;
		public var borderLeftColor:int = 0;
		public var borderRightColor:int = 0;
		public var borderBottomColor:int = 0;
		
		//渐变用色
		public var bgColor2:int = 0;
		//渐变角度
		public var bgRotaion:Number = Math.PI/2;
		//圆角,border不为0是有效
		public var ellipse:int = 0;
		//是否隐藏多余边框
//		public var hidden:Boolean = false;
		
		//背景的阴影滤镜
		public var bgShadowDist:int = 0;
		public var bgShadowBlur:int = 0;
		public var bgShadowColor:uint = 0x000000;
		
		/**
		 * 快捷输入左上右下内边距
		 * @param args
		 */		
		public function setPadding(...args):void
		{
			if(!args || !args.length) return;
			var i:int=0;
			paddingLeft = (args[i])?args[i++]:0;
			paddingTop = (args[i])?args[i++]:paddingLeft;
			paddingRight = (args[i])?args[i++]:paddingTop;
			paddingBottom = (args[i])?args[i++]:paddingRight;
		}
		
		/**
		 * 快捷输入左上右下外边框
		 * @param args
		 */	
		public function setBorder(...args):void
		{
			if(!args || !args.length) return;
			var i:int=0;
			borderLeft = (args[i])?args[i++]:0;
			borderTop = (args[i])?args[i++]:borderLeft;
			borderRight = (args[i])?args[i++]:borderTop;
			borderBottom = (args[i])?args[i++]:borderRight;
		}
		
		/**
		 * 快捷输入左上右下外边框颜色
		 * @param args
		 */	
		public function setBorderColor(...args):void
		{
			if(!args || !args.length) return;
			var i:int=0;
			borderLeftColor = (args[i])?args[i++]:0;
			borderTopColor = (args[i])?args[i++]:borderLeftColor;
			borderRightColor = (args[i])?args[i++]:borderTopColor;
			borderBottomColor = (args[i])?args[i++]:borderRightColor;
		}
		
		public function destroy():void
		{
			PubFun.killObject(this);
		}
	}
}